ReadPartialResource
long offset ; start of section to be obtained
Ptr buffer ; buffer to contain the partial resource long count ; length of section
procedures to manipulate a subsection of a large, unwieldy resource that may
change the size of a resource on disk to a size that you specify.
Be aware that having a copy of a resource in memory when you are using the
partial resource routines may cause problems. If you have modified the copy in
memory and then access the resource on disk using either the
lose changes made to the copy in memory.
which allows you to work with small portions of large resources. This
procedure reads into memory a section of the resource, which is specified by
the parameter theResource. The value of the offset parameter marks the
beginning of the subsection as measured in bytes from the start of the
resource. The length of the section is given by the value of the count parameter.
buffer you indicate with the buffer parameter. You are responsible for the
procedure to release the memory occupied by this buffer. Call the ResError function to check for errors.
reads it from the disk and ResError returns the resourceInMemory result code. If you have loaded the resource into memory and modified it, you will lose
procedure. If you try to read past the end of a resource or your offset is out of
bounds, ResError returns the inputOutOfBounds error. If the handle named by the parameter theResource is not in any open resource files, ResError returns the resNotFound result code.
When using partial resource routines, you should call the SetResLoad procedure specifying FALSE for its load parameter before you call the reading the entire resource into memory. Be sure to restore the normal state
Note: If the resource is in memory and you want part of its data, you
should use the BlockMove procedure instead of the resourceInMemory (-188) Resource already in memory
inputOutOfBounds (-190) Offset or count out of bounds
resNotFound (-192) Resource not found